.multiplayer-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    margin-right: 402px;
}

.multiplayer-menu h2 {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.menu-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    max-width: 370px;
    width: 100%;
}

/* Increase vertical spacing between the primary top-level menu buttons */
.menu-container > .menu-button + .menu-button {
    margin-top: 1rem;
}

.menu-button {
    background-color: #1B7222;
    width: 100%;
    padding: 8px 15px 8px 7px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.8), 0px 3px 1px rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 0 rgba(70, 70, 70, .9);
}

    .menu-button.primary {
        background-color: #259634;
        color: white;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }

    .menu-button.secondary {
        background: linear-gradient(45deg, #2196F3, #1976D2);
        color: white;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }

    .menu-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    }

.menu-button:active {
    transform: translateY(0);
}

.menu-button::before {
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.menu-button:hover::before {
    left: 100%;
}

#joinSection {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#joinSection.show {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.room-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.room-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.2);
}

.room-input::placeholder {
    color: white;
    font-style: italic;
}

.status-message {
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.status-message.info {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.menu-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.menu-button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Room Info Display */
.room-info {
    text-align: center;
    padding: 1.5rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: none;
}

.room-info h3 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1.2rem;
}

    .room-info p {
        margin: 0.25rem 0;
        color: white;
        font-size: 1.1rem;
    }

.menu-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.player-list-container {
    margin-left: 2rem;
    border-radius: 12px;
    padding: 1.5rem;
    width: 200px;
}

.player-list-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #F7FFFB;
    text-align: center;
}

.player-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.1rem;
    color: #F7FFFB;
}

.player-item:last-child {
    border-bottom: none;
}

/* Share button styles */
.share-button {
    background-color: #259634;
    width: 100%;
    color: white;
    padding: 8px 15px 8px 7px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-shadow: 1px 1px 0 rgba(70, 70, 70, .9);
}

    .share-button:hover {
        background-color: #2DB73D;
        transform: translateY(-2px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    }

.share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.share-button.copied {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.share-button .share-icon {
    font-size: 1.1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.share-button:hover .share-icon {
    transform: scale(1.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .multiplayer-menu {
        padding: 1rem;
        margin-right: 0 !important; /* Remove desktop ad banner spacing on mobile */
    }
    
    .multiplayer-menu h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .menu-container {
        padding: 2rem;
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .menu-button {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }

    .menu-container > .menu-button + .menu-button {
        margin-top: 1rem;
    }

    .menu-wrapper {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .player-list-container {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        max-width: 370px;
    }
}

/* Animation for showing/hiding sections */
.slide-in {
    animation: slideIn 0.3s ease-out;
}

.slide-out {
    animation: slideOut 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Lobby Connection Loader */
.lobby-connection-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 410px; /* space for ad banner */
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    backdrop-filter: blur(10px);
    z-index: 9999;
    color: white;
    font-size: 1.5rem;
    font-weight: 500;
}

.lobby-loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-radius: 50%;
    border-top-color: #2196F3;
    animation: spin 1s ease-in-out infinite;
}

/* Hide loader by default */
.lobby-connection-loader.hidden {
    display: none;
}

/* Mobile: Full screen loader without ad banner space */
@media (max-width: 768px) {
    .lobby-connection-loader {
        right: 0; /* Full width on mobile */
    }
}

