
/* LOBBY STYLES - REDESIGN */

/* Animation for background grid */
@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

body {
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

#lobby-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: 
        linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.8)),
        linear-gradient(90deg, rgba(50,50,50,0.2) 1px, transparent 1px),
        linear-gradient(rgba(50,50,50,0.2) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    animation: gridMove 4s linear infinite;
    z-index: 100;
}

.lobby-container {
    width: 90%;
    max-width: 450px;
    /* Glassmorphism */
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 255, 0.1);
    
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: #fff;
    animation: fadeIn 0.5s ease-out;
}

/* Mobile Layout Tweaks */
@media (max-width: 600px) {
    .lobby-container {
        padding: 20px; /* More compact on mobile */
        width: 95%;
    }
    .lobby-container h1 {
        font-size: 2.5rem; /* Smaller title */
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.lobby-container h1 {
    font-size: 3.5rem;
    margin: 0 0 10px 0;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 900;
    /* Gradient Text */
    background: linear-gradient(135deg, #00ffff, #00ffaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    letter-spacing: -2px;
}

.subtitle {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    letter-spacing: 8px;
    font-weight: 400;
    margin-bottom: 30px; /* Reduced from 40px */
    text-transform: uppercase;
    -webkit-text-fill-color: #aaa; /* Override gradient */
}

@media (max-width: 600px) {
    .subtitle {
        margin-bottom: 20px; /* Even smaller for mobile */
        letter-spacing: 4px;
    }
}

.input-group {
    margin-bottom: 20px; /* Reduced from 25px */
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #333;
    color: #fff;
    border-radius: 12px;
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]::placeholder {
    color: #555;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

input[type="text"]:focus {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lobby-btn {
    padding: 18px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

/* Primary Button (Quick Match) */
#btn-find-match {
    background: linear-gradient(135deg, #00ffff 0%, #00ccff 100%);
    color: #000;
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.3);
}

#btn-find-match:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.4);
}

#btn-find-match:active {
    transform: scale(0.98);
}

/* Secondary Button (Create Room) */
#btn-create-room {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#btn-create-room:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

.divider {
    color: #444;
    font-size: 0.8rem;
    margin: 5px 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.divider::before, .divider::after {
    content: "";
    height: 1px;
    width: 30px;
    background: #333;
}

.join-room-group {
    display: flex;
    gap: 10px;
}

#room-code-input {
    flex: 2;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    padding: 12px;
}

#btn-join-room {
    flex: 1;
    background: #222;
    color: #fff;
    border: 1px solid #333;
}

#btn-join-room:hover {
    background: #333;
    border-color: #555;
    color: #00ffff;
}

.status-msg {
    margin-top: 25px;
    color: #00ffff;
    font-weight: bold;
    min-height: 24px;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* --- HELP BUTTON --- */
.help-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    z-index: 10;
}

.help-btn:hover {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 10px #00ffff;
}

/* --- MODAL --- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transform: scale(1);
    transition: transform 0.3s;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.8);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover { color: #fff; }

.tips-list p {
    color: #ccc;
    margin: 10px 0;
    font-size: 0.95rem;
}

.instr-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #00ffff;
    margin: 20px 0;
}

/* ... existing desktop keys ... */
.keys-display {
    display: flex;
    gap: 5px;
}

.key-box {
    width: 30px;
    height: 30px;
    border: 1px solid #444;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #ccc;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.2);
    box-shadow: 0 2px 0 #222;
}

.gesture-display {
    position: relative;
    width: 50px; /* Smaller */
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-icon {
    font-size: 1.5rem; /* Smaller */
    animation: swipeAnim 2s infinite ease-in-out;
}

.swipe-arrows span {
    position: absolute;
    color: rgba(255,255,255,0.2);
    font-weight: bold;
}
.swipe-arrows span:nth-child(1) { left: 0; top: 50%; transform: translateY(-50%); } /* Left */
.swipe-arrows span:nth-child(2) { top: 0; left: 50%; transform: translateX(-50%); } /* Up */
.swipe-arrows span:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); } /* Down */
.swipe-arrows span:nth-child(4) { right: 0; top: 50%; transform: translateY(-50%); } /* Right */

@keyframes swipeAnim {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10px, 0); }
    50% { transform: translate(10px, 0); }
    75% { transform: translate(0, -10px); }
}