:where(.page-lobby) header {
    margin-bottom: 20px;
}

:where(.page-lobby) h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

:where(.page-lobby) .subtitle {
    color: white;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

:where(.page-lobby) .lobby-content {
    background: white;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

:where(.page-lobby) .action-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

:where(.page-lobby) .input-group {
    margin-bottom: 12px;
}

:where(.page-lobby) .input-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 6px;
    display: block;
}

:where(.page-lobby) .input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

:where(.page-lobby) .input-field:focus {
    outline: none;
    border-color: #FF6B6B;
}

:where(.page-lobby) .input-field::placeholder {
    color: #aaa;
}

:where(.page-lobby) #nickname::placeholder {
    color: #757575;
    font-style: italic;
    opacity: 1;
}

:where(.page-lobby) #nickname:focus::placeholder {
    opacity: 0;
}

:where(.page-lobby) .btn {
    margin-bottom: 20px;
}

:where(.page-lobby) .btn-primary:hover {
    opacity: 0.9;
}

:where(.page-lobby) .btn-primary.loading {
    position: relative;
    color: transparent;
}

:where(.page-lobby) .btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

:where(.page-lobby) .player-count {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin-top: 8px;
}

:where(.page-lobby) .how-to-play-link {
    display: block;
    margin: 0 auto;
    background: none;
    border: 0;
    color: white;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    min-height: 44px;
    padding: 8px 12px;
}

:where(.page-lobby) .how-to-play-modal {
    margin: auto;
    width: calc(100% - 32px);
    max-width: 420px;
    max-height: calc(100dvh - 32px);
    padding: 20px;
    border: 0;
    border-radius: 16px;
    color: #333;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

:where(.page-lobby) .how-to-play-modal[open] {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

:where(.page-lobby) .how-to-play-modal::backdrop {
    background: rgba(0,0,0,0.6);
}

:where(.page-lobby) .how-to-play-content {
    min-height: 0;
    overflow-y: auto;
    line-height: 1.5;
    font-size: 15px;
}

:where(.page-lobby) .how-to-play-content h2 {
    font-size: 20px;
    color: #333;
    opacity: 1;
    text-shadow: none;
}

:where(.page-lobby) .how-to-play-content p {
    margin-top: 12px;
}

:where(.page-lobby) .how-to-play-modal form {
    flex-shrink: 0;
    text-align: center;
}

:where(.page-lobby) .how-to-play-modal .btn {
    margin: 0;
    min-width: 120px;
}

:where(.page-lobby) .divider {
    display: flex;
    align-items: center;
    margin: 8px 0 20px 0;
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

:where(.page-lobby) .divider::before,
:where(.page-lobby) .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

:where(.page-lobby) .divider span {
    padding: 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-height: 700px) {
    :where(.page-lobby) header {
        margin-bottom: 16px;
    }

    :where(.page-lobby) h1 {
        font-size: 32px;
    }

    :where(.page-lobby) .subtitle {
        font-size: 14px;
    }

    :where(.page-lobby) .lobby-content {
        padding: 20px 16px;
    }

}

@media (max-height: 600px) {
    :where(.page-lobby) header {
        margin-bottom: 12px;
    }

    :where(.page-lobby) h1 {
        font-size: 28px;
    }

    :where(.page-lobby) .input-field,
    :where(.page-lobby) .input-group {
        margin-bottom: 10px;
    }

    :where(.page-lobby) .btn {
        padding: 12px 16px;
        margin-bottom: 16px;
    }

    :where(.page-lobby) .divider {
        margin: 4px 0 16px 0;
    }

}

@media (max-height: 500px) {
    :where(.page-lobby) .container {
        padding: 8px;
    }

    :where(.page-lobby) .lobby-content {
        padding: 16px;
    }

    :where(.page-lobby) .input-field,
    :where(.page-lobby) .input-group {
        margin-bottom: 8px;
    }

    :where(.page-lobby) .btn {
        padding: 10px;
        font-size: 13px;
        margin-bottom: 12px;
    }

    :where(.page-lobby) .divider {
        margin: 0 0 12px 0;
    }

}

:where(.page-lobby) .divider, :where(.page-lobby) .player-count {
    flex-shrink: 0;
}
