.lobby-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Subtle background elements for depth */
.lobby-container::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(255,213,79,0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Classic Javanese Floral Ornament at bottom */
.lobby-container::after {
    content: '';
    position: fixed;
    bottom: 0; left: 0; width: 100%; height: 35vh;
    background-image: url('../background/ornament.png');
    background-size: cover;
    background-position: bottom center;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

.lobby-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.logo {
    font-size: 4rem;
    color: var(--gold);
    text-shadow: 0 4px 15px rgba(255, 213, 79, 0.4), 2px 2px 4px var(--shadow);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    color: var(--cream);
    font-style: italic;
    letter-spacing: 1px;
}

@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.lobby-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.card {
    background: rgba(26, 54, 45, 0.6); /* Glassmorphism background */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border: 1px solid rgba(255, 213, 79, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.card h2 {
    color: var(--gold);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(255, 213, 79, 0.3);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-weight: 600;
}

input[type="text"] {
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--cream);
    background: rgba(0,0,0,0.2);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--gold);
}

.avatar-selection label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

.avatar-item {
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.avatar-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.avatar-item span {
    font-size: 0.7rem;
    text-align: center;
    opacity: 0.8;
}

.avatar-item:hover img {
    transform: scale(1.1);
}

.avatar-item.selected {
    border-color: var(--gold);
    transform: scale(1.1);
}

.avatar-item.selected img {
    box-shadow: 0 0 15px var(--gold);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.btnCreateRoom {
    width: 100%;
    max-width: 300px;
    font-size: 1.2rem;
    padding: 15px;
}

.divider {
    font-style: italic;
    opacity: 0.7;
}

.join-group {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.join-group input {
    flex: 1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.room-code-display {
    font-family: monospace;
    font-size: 2.5rem;
    color: var(--gold);
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 8px;
    margin: 15px 0;
    letter-spacing: 5px;
}

/* Scrollbar styles for avatar grid */
.avatar-grid::-webkit-scrollbar {
    width: 6px;
}
.avatar-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.avatar-grid::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

/* Modal waiting styles */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(10, 25, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(26, 54, 45, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border: 1px solid rgba(255, 213, 79, 0.3);
    text-align: center;
    max-width: 90%;
    animation: scaleUp 0.3s ease-out;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    color: var(--gold);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(255, 213, 79, 0.3);
}

.waiting-text {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--cream);
    opacity: 0.9;
}
